import { drawCanvas } from '../../../../../Hooks/useCanvas'

export const high_source = new ol.source.Vector({})
export function newSourceLayer(map) {
  let canvas = drawCanvas(map)
  const style = new ol.style.Style({
    image: new ol.style.Icon({
      img: canvas,
      imgSize: [canvas.width, canvas.height]
    })
  })
  const high_layer = new ol.layer.Vector({
    source: high_source,
    title: '高亮图层',
    style
  })
  map.addLayer(high_layer)
  return {
    high_source,
    high_layer
  }
}
